#include "unit--.h"
#include "WMIConnectionMng.h"

using namespace unit_minus;

testSuite(ConnectionSuite);

testCase(createConnectionTest_local, ConnectionSuite)
{
	WMIConnectionMng* wmiMng = new WMIConnectionMng();
	WMIConnection wmiConnection;

	int expected = 0;

	int result = wmiMng->createConnection(L"Administrator", L"asdfghjk", L"\\root\\cimv2", wmiConnection);

	assertTrue(equalValueInfo(expected,result));

	expected = 1;
	result = wmiMng->createConnection(L"Administrator", L"asdfghjk",L"", wmiConnection);

	assertTrue(equalValueInfo(expected, result));

	delete wmiMng;
}

testCase(createConnectionTest_remote, ConnectionSuite)
{
	WMIConnectionMng* wmiMng = new WMIConnectionMng();
	WMIConnection wmiConnection;

	int expected = 0;
	int result = wmiMng->createConnection(L"Administrator", L"asdfghjk", L"\\root\\cimv2", wmiConnection);

	assertTrue(equalValueInfo(expected,result));

	expected = 1;
	result = wmiMng->createConnection(L"Administrator", L"asdfghjk",L"", wmiConnection);

	assertTrue(equalValueInfo(expected, result));

	delete wmiMng;
}